/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author zhaoxiancheng
* @date 2021-11-18
**/
@Entity
@Data
@Table(name="exam_info")
public class ExamInfo implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    @ApiModelProperty(value = "编号自增")
    private Integer id;

    @Column(name = "exam")
    @ApiModelProperty(value = "题目")
    private String exam;

    @Column(name = "answer")
    @ApiModelProperty(value = "答案")
    private String answer;

    @Column(name = "score")
    @ApiModelProperty(value = "分值")
    private String score;

    @Column(name = "chose")
    @ApiModelProperty(value = "选项")
    private String chose;

    @Column(name = "status")
    @ApiModelProperty(value = "是否可用：0-可用；1-停用")
    private String status;

    @Column(name = "exam_type_id")
    @ApiModelProperty(value = "题型编号")
    private String examTypeId;

    @Column(name = "is_only")
    @ApiModelProperty(value = "答案是否唯一：0-是；1-否")
    private String isOnly;

    @Column(name = "description")
    @ApiModelProperty(value = "正向得分描述")
    private String description;

    @Column(name = "title")
    @ApiModelProperty(value = "得分=5")
    private String title;

    @Column(name = "exam_database_id")
    @ApiModelProperty(value = "题库Id")
    private Long examDatabaseId;

    @Column(name = "exam_no")
    @ApiModelProperty(value = "题目编号")
    private String examNo;

    @Column(name = "reversal_desc")
    @ApiModelProperty(value = "负向得分描述")
    private String reversalDesc;

    @Column(name = "reversal_title")
    @ApiModelProperty(value = "得分=1")
    private String reversalTitle;

    @Column(name = "group_code")
    @ApiModelProperty(value = "分组Code")
    private String groupCode;

    public void copy(ExamInfo source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}